package cn.yougou.controller;

import cn.yougou.common.DtoUtil;
import cn.yougou.dto.Dto;

import cn.yougou.pojo.YgOrder;
import cn.yougou.service.admin.YgAdminOrderService;
import cn.yougou.vo.YgOrderVo;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

/**
 * @auth 韩帅锋
 * @date 2020/12/27 9:07
 */


@RestController
@RequestMapping("ygOrder")
public class YgAdminOrderController {


    /**
     * 服务对象
     */
    @Reference
    private YgAdminOrderService ygAdminOrderService;

    /**
     * 后台管理订单信息
     *
     * @return
     */
    @PostMapping("selOrderAll")
    public Dto selOrderAll(@RequestBody YgOrderVo ygOrderVo){
        return DtoUtil.returnDataSuccess(ygAdminOrderService.orderVo(ygOrderVo));

    }

    @PostMapping("delete")
    public Dto delete(@RequestBody YgOrderVo ygOrderVo){
        return DtoUtil.returnDataSuccess(ygAdminOrderService.deleteById(ygOrderVo));
    }

}
